uniform float width;
uniform float height;

varying vec4 encodedPos;

void main(void)
{ 
	
	// get absolute tex coords ([0..width],[0..height])
	float x = floor(mod(gl_VertexID, width));
	float y = floor(gl_VertexID/width);
	
	// get normalized tex coords ([0..1],[0..1])
	float s = (x+1)/width;
	float t = (y+1)/height;
    
	// original vertex has the agent position and position
	// is a function of vertex id
	vec4 pos = vec4(s,t,0,1);
	encodedPos = gl_Vertex;
	
    gl_Position = gl_ModelViewProjectionMatrix * pos;
}